﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Ajeelee.Core.Utils;
using FxhjpgWeb.Business;
using FxhjpgWeb.Model;
using FxhjpgWeb.WebSite.Code;

namespace FxhjpgWeb.WebSite.en.pfdn
{
    public partial class order : PageBase
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (IsPost)
            {
                try
                {
                    Message info = new Message();
                    info.Username = Utility.StripHTML(FormParam("username"));
                    info.Tel = Utility.StripHTML(FormParam("tel"));
                    info.Fax = Utility.StripHTML(FormParam("fax"));
                    info.Email = Utility.StripHTML(FormParam("email"));
                    info.QQ = Utility.StripHTML(FormParam("qq"));
                    info.Address = Utility.StripHTML(FormParam("address"));
                    info.Zip = Utility.StripHTML(FormParam("zip"));
                    info.Title = Utility.StripHTML(FormParam("title"));
                    info.Num = Utility.StripHTML(FormParam("num")).ToInt();
                    info.Content = Utility.StripHTML(FormParam("content"));
                    info.InTime = DateTime.Now;
                    info.InIP = IPAddress;
                    info.State = 2;
                    new MessageBusinessFactory().CreateMessageBusiness().Insert(info);

                    MessageBoxGo("success!", "/en/pfdn/order.aspx");
                }
                catch (Exception ex)
                {
                    Function.WriteErrorLog(ex);
                }
            }
        }
    }
}